/**
 * 设备模拟数据
 * 
 * 数据结构说明：
 * - 一级列表：设备类型（如监护仪、除颤仪等）
 * - 二级记录：具体设备（如N系列、D3系列等）
 * - 每个设备包含图片和坐标文件
 */

// 生成模拟图片数据
const generateMockImages = (deviceName, count = 3) => {
  return Array.from({ length: count }, (_, index) => ({
    id: `img_${deviceName}_${index + 1}`,
    name: `UI_${index + 1}_0_0_0.png`,
    url: `/icons/medical-imaging.svg`, // 使用现有图标作为占位符
    thumbnail: `/icons/medical-imaging.svg`,
    size: 1024 * 1024, // 1MB
    type: 'image/png',
    uploadTime: new Date().toISOString()
  }))
}

// 生成模拟坐标数据
const generateMockCoordinateLog = (deviceName) => {
  const coordinateData = {
    "UI_1_0_0_0": [
      { "orgin_name": "主界面" },
      { "next": "UI_1_1_0_0", "name": "下一步", "x": 425, "y": 671, "width": 144, "height": 38 },
      { "next": "UI_1_2_0_0", "name": "设置", "x": 600, "y": 671, "width": 144, "height": 38 }
    ],
    "UI_1_1_0_0": [
      { "orgin_name": "功能界面1" },
      { "next": "UI_1_0_0_0", "name": "返回", "x": 238, "y": 671, "width": 144, "height": 38 },
      { "next": "UI_1_2_0_0", "name": "确认", "x": 425, "y": 671, "width": 144, "height": 38 }
    ],
    "UI_1_2_0_0": [
      { "orgin_name": "设置界面1" },
      { "next": "UI_1_0_0_0", "name": "返回", "x": 238, "y": 671, "width": 144, "height": 38 },
      { "next": "", "name": "保存", "x": 425, "y": 671, "width": 144, "height": 38 }
    ]
  }

  return {
    id: `coord_log_${deviceName}`,
    name: 'log.txt',
    content: JSON.stringify(coordinateData, null, 2),
    size: JSON.stringify(coordinateData).length,
    type: 'text/plain',
    uploadTime: new Date().toISOString()
  }
}

// 急救与生命支持分类的模拟数据
export const mockDevices = [
  // 监护仪 (category)
  {
    id: 'monitor_category',
    name: '监护仪',
    description: '监护仪设备分类',
    type: 'category',
    category: 'emergency_life_support',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // N系列 (device)
      {
        id: 'monitor_n_series',
        name: 'N系列',
        description: 'N系列监护仪',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'monitor_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('monitor_n_series'),
        coordinateLog: generateMockCoordinateLog('monitor_n_series'),
        coordinateFiles: []
      },
      // ePM系列 (device)
      {
        id: 'monitor_epm_series',
        name: 'ePM系列',
        description: 'ePM系列监护仪',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'monitor_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('monitor_epm_series'),
        coordinateLog: generateMockCoordinateLog('monitor_epm_series'),
        coordinateFiles: []
      },
      // R12心电图机 (device)
      {
        id: 'monitor_r12_ecg',
        name: 'R12心电图机',
        description: 'R12心电图机',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'monitor_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('monitor_r12_ecg'),
        coordinateLog: generateMockCoordinateLog('monitor_r12_ecg'),
        coordinateFiles: []
      },
      // mWear系列 (device)
      {
        id: 'monitor_mwear_series',
        name: 'mWear系列',
        description: 'mWear系列监护仪',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'monitor_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('monitor_mwear_series'),
        coordinateLog: generateMockCoordinateLog('monitor_mwear_series'),
        coordinateFiles: []
      }
    ]
  },
  
  // 除颤仪 (category)
  {
    id: 'defibrillator_category',
    name: '除颤仪',
    description: '除颤仪设备分类',
    type: 'category',
    category: 'emergency_life_support',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // D3系列 (device)
      {
        id: 'defibrillator_d3_series',
        name: 'D3系列',
        description: 'D3系列除颤仪',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'defibrillator_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('defibrillator_d3_series'),
        coordinateLog: generateMockCoordinateLog('defibrillator_d3_series'),
        coordinateFiles: []
      },
      // D6系列 (device)
      {
        id: 'defibrillator_d6_series',
        name: 'D6系列',
        description: 'D6系列除颤仪',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'defibrillator_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('defibrillator_d6_series'),
        coordinateLog: generateMockCoordinateLog('defibrillator_d6_series'),
        coordinateFiles: []
      }
    ]
  },
  
  // 健康一体机 (category)
  {
    id: 'health_kiosk_category',
    name: '健康一体机',
    description: '健康一体机设备分类',
    type: 'category',
    category: 'emergency_life_support',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // D3系列 (device)
      {
        id: 'health_kiosk_d3_series',
        name: 'D3系列',
        description: 'D3系列健康一体机',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'health_kiosk_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('health_kiosk_d3_series'),
        coordinateLog: generateMockCoordinateLog('health_kiosk_d3_series'),
        coordinateFiles: []
      },
      // D6系列 (device)
      {
        id: 'health_kiosk_d6_series',
        name: 'D6系列',
        description: 'D6系列健康一体机',
        type: 'device',
        category: 'emergency_life_support',
        parentId: 'health_kiosk_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/medical-imaging.svg',
        images: generateMockImages('health_kiosk_d6_series'),
        coordinateLog: generateMockCoordinateLog('health_kiosk_d6_series'),
        coordinateFiles: []
      }
    ]
  },

  // ========== 体外诊断分类 ==========
  
  // 生化分析仪 (category)
  {
    id: 'biochemistry_analyzer_category',
    name: '生化分析仪',
    description: '生化分析仪设备分类',
    type: 'category',
    category: 'in_vitro_diagnostics',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // BS360E系列 (device)
      {
        id: 'biochemistry_bs360e_series',
        name: 'BS360E系列',
        description: 'BS360E系列生化分析仪',
        type: 'device',
        category: 'in_vitro_diagnostics',
        parentId: 'biochemistry_analyzer_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/tiwai.png',
        images: generateMockImages('biochemistry_bs360e_series'),
        coordinateLog: generateMockCoordinateLog('biochemistry_bs360e_series'),
        coordinateFiles: []
      },
      // BS480系列 (device)
      {
        id: 'biochemistry_bs480_series',
        name: 'BS480系列',
        description: 'BS480系列生化分析仪',
        type: 'device',
        category: 'in_vitro_diagnostics',
        parentId: 'biochemistry_analyzer_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/tiwai.png',
        images: generateMockImages('biochemistry_bs480_series'),
        coordinateLog: generateMockCoordinateLog('biochemistry_bs480_series'),
        coordinateFiles: []
      }
    ]
  },

  // 免疫分析仪 (category)
  {
    id: 'immunoassay_analyzer_category',
    name: '免疫分析仪',
    description: '免疫分析仪设备分类',
    type: 'category',
    category: 'in_vitro_diagnostics',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // CL1000i系列 (device)
      {
        id: 'immunoassay_cl1000i_series',
        name: 'CL1000i系列',
        description: 'CL1000i系列免疫分析仪',
        type: 'device',
        category: 'in_vitro_diagnostics',
        parentId: 'immunoassay_analyzer_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/tiwai.png',
        images: generateMockImages('immunoassay_cl1000i_series'),
        coordinateLog: generateMockCoordinateLog('immunoassay_cl1000i_series'),
        coordinateFiles: []
      },
      // CL900i系列 (device)
      {
        id: 'immunoassay_cl900i_series',
        name: 'CL900i系列',
        description: 'CL900i系列免疫分析仪',
        type: 'device',
        category: 'in_vitro_diagnostics',
        parentId: 'immunoassay_analyzer_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/tiwai.png',
        images: generateMockImages('immunoassay_cl900i_series'),
        coordinateLog: generateMockCoordinateLog('immunoassay_cl900i_series'),
        coordinateFiles: []
      }
    ]
  },

  // ========== 输注泵分类 ==========
  
  // 输液泵 (category)
  {
    id: 'infusion_pump_category',
    name: '输液泵',
    description: '输液泵设备分类',
    type: 'category',
    category: 'infusion_pump',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // 深科输液泵系列 (device)
      {
        id: 'infusion_pump_shenke_series',
        name: '深科输液泵系列',
        description: '深科输液泵系列',
        type: 'device',
        category: 'infusion_pump',
        parentId: 'infusion_pump_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/shuzhu.png',
        images: generateMockImages('infusion_pump_shenke_series'),
        coordinateLog: generateMockCoordinateLog('infusion_pump_shenke_series'),
        coordinateFiles: []
      },
      // BeneFusion输液泵系列 (device)
      {
        id: 'infusion_pump_benefusion_series',
        name: 'BeneFusion输液泵系列',
        description: 'BeneFusion输液泵系列',
        type: 'device',
        category: 'infusion_pump',
        parentId: 'infusion_pump_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/shuzhu.png',
        images: generateMockImages('infusion_pump_benefusion_series'),
        coordinateLog: generateMockCoordinateLog('infusion_pump_benefusion_series'),
        coordinateFiles: []
      }
    ]
  },

  // ========== 医学影像分类 ==========
  
  // 超声 (category)
  // {
  //   id: 'ultrasound_category',
  //   name: '超声',
  //   description: '超声设备分类',
  //   type: 'category',
  //   category: 'medical_imaging',
  //   status: 'active',
  //   isCategory: true,
  //   imageCount: 0,
  //   thumbnail: null,
  //   images: [],
  //   coordinateLog: null,
  //   coordinateFiles: [],
  //   children: [
  //     // DC40系列 (device)
  //     {
  //       id: 'ultrasound_dc40_series',
  //       name: 'DC40系列',
  //       description: 'DC40系列超声设备',
  //       type: 'device',
  //       category: 'medical_imaging',
  //       parentId: 'ultrasound_category',
  //       status: 'active',
  //       isCategory: false,
  //       imageCount: 3,
  //       thumbnail: '/icons/yixue.png',
  //       images: generateMockImages('ultrasound_dc40_series'),
  //       coordinateLog: generateMockCoordinateLog('ultrasound_dc40_series'),
  //       coordinateFiles: []
  //     },
  //     // M9系列 (device)
  //     {
  //       id: 'ultrasound_m9_series',
  //       name: 'M9系列',
  //       description: 'M9系列超声设备',
  //       type: 'device',
  //       category: 'medical_imaging',
  //       parentId: 'ultrasound_category',
  //       status: 'active',
  //       isCategory: false,
  //       imageCount: 3,
  //       thumbnail: '/icons/yixue.png',
  //       images: generateMockImages('ultrasound_m9_series'),
  //       coordinateLog: generateMockCoordinateLog('ultrasound_m9_series'),
  //       coordinateFiles: []
  //     }
  //   ]
  // },

  // X射线 (category)
  {
    id: 'xray_category',
    name: 'X射线',
    description: 'X射线设备分类',
    type: 'category',
    category: 'medical_imaging',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // DigiEye680系列 (device)
      {
        id: 'xray_digieye680_series',
        name: 'DigiEye680系列',
        description: 'DigiEye680系列X射线设备',
        type: 'device',
        category: 'medical_imaging',
        parentId: 'xray_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/yixue.png',
        images: generateMockImages('xray_digieye680_series'),
        coordinateLog: generateMockCoordinateLog('xray_digieye680_series'),
        coordinateFiles: []
      },
      // DigiEye280系列 (device)
      {
        id: 'xray_digieye280_series',
        name: 'DigiEye280系列',
        description: 'DigiEye280系列X射线设备',
        type: 'device',
        category: 'medical_imaging',
        parentId: 'xray_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/yixue.png',
        images: generateMockImages('xray_digieye280_series'),
        coordinateLog: generateMockCoordinateLog('xray_digieye280_series'),
        coordinateFiles: []
      }
    ]
  },

  // ========== 外科设备分类 ==========
  
  // 手术灯 (category)
  {
    id: 'surgical_light_category',
    name: '手术灯',
    description: '手术灯设备分类',
    type: 'category',
    category: 'surgical_equipment',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // HyLED X系列 (device)
      {
        id: 'surgical_light_hyled_x_series',
        name: 'HyLED X系列',
        description: 'HyLED X系列手术灯',
        type: 'device',
        category: 'surgical_equipment',
        parentId: 'surgical_light_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/waike.png',
        images: generateMockImages('surgical_light_hyled_x_series'),
        coordinateLog: generateMockCoordinateLog('surgical_light_hyled_x_series'),
        coordinateFiles: []
      },
      // HyLED C系列 (device)
      {
        id: 'surgical_light_hyled_c_series',
        name: 'HyLED C系列',
        description: 'HyLED C系列手术灯',
        type: 'device',
        category: 'surgical_equipment',
        parentId: 'surgical_light_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/waike.png',
        images: generateMockImages('surgical_light_hyled_c_series'),
        coordinateLog: generateMockCoordinateLog('surgical_light_hyled_c_series'),
        coordinateFiles: []
      }
    ]
  },

  // 手术床 (category)
  {
    id: 'surgical_table_category',
    name: '手术床',
    description: '手术床设备分类',
    type: 'category',
    category: 'surgical_equipment',
    status: 'active',
    isCategory: true,
    imageCount: 0,
    thumbnail: null,
    images: [],
    coordinateLog: null,
    coordinateFiles: [],
    children: [
      // HyBase3000 (device)
      {
        id: 'surgical_table_hybase3000',
        name: 'HyBase3000',
        description: 'HyBase3000手术床',
        type: 'device',
        category: 'surgical_equipment',
        parentId: 'surgical_table_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/waike.png',
        images: generateMockImages('surgical_table_hybase3000'),
        coordinateLog: generateMockCoordinateLog('surgical_table_hybase3000'),
        coordinateFiles: []
      },
      // UniBase30 (device)
      {
        id: 'surgical_table_unibase30',
        name: 'UniBase30',
        description: 'UniBase30手术床',
        type: 'device',
        category: 'surgical_equipment',
        parentId: 'surgical_table_category',
        status: 'active',
        isCategory: false,
        imageCount: 3,
        thumbnail: '/icons/waike.png',
        images: generateMockImages('surgical_table_unibase30'),
        coordinateLog: generateMockCoordinateLog('surgical_table_unibase30'),
        coordinateFiles: []
      }
    ]
  }
]

// 模拟可点击区域数据
export const mockClickableAreas = [
  {
    id: 'area_1',
    name: '主菜单按钮',
    x: 100,
    y: 200,
    width: 150,
    height: 50,
    nextImage: 'menu_page.jpg',
    description: '点击进入主菜单'
  },
  {
    id: 'area_2',
    name: '设置按钮',
    x: 300,
    y: 200,
    width: 150,
    height: 50,
    nextImage: 'settings_page.jpg',
    description: '点击进入设置页面'
  }
]
